package com.ffs.game.scene.stage.input;

import com.badlogic.gdx.Input;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.ffs.game.scene.control.IWalkControl;

/**
 * 行走输入监听
 *
 * @author ffs80
 */
public class WalkInputListener extends InputListener {

    private IWalkControl walkControl;

    public WalkInputListener(IWalkControl walkControl) {
        this.walkControl = walkControl;
    }

    @Override
    public boolean keyDown(InputEvent event, int keycode) {
        switch (keycode) {
            case Input.Keys.A:
                walkControl.walkLeft();
                break;
            case Input.Keys.W:
                walkControl.walkTop();
                break;
            case Input.Keys.D:
                walkControl.walkRight();
                break;
            case Input.Keys.S:
                walkControl.walkDown();
                break;
            default:
                break;
        }
        return false;
    }

    @Override
    public boolean keyUp(InputEvent event, int keycode) {
        return false;
    }
}
